<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改fantasynpc语句')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-talk-edit" th:object="${fantasyNpcTalk}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">内容：</label>
                <div class="col-sm-8">
                    <input name="content" th:field="*{content}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">所属npc：</label>
                <div class="col-sm-8">
                    <select id="npcId" name="npcId" class="form-control">
                        <option value="0">全部</option>
                        <option th:each="fantasyNpc:${fantasyNpcList}" th:alt-title="${fantasyNpc.npcDesc}" th:value="${fantasyNpc.npcId}" th:text="${fantasyNpc.npcName}" th:selected="${fantasyNpc.npcId == fantasyNpcTalk.npcId}" value="1">
                            aaa
                        </option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">是否显示：</label>
                <div class="col-sm-8">
                    <select name="isDisplay" class="form-control m-b" th:with="type=${@dict.getType('display_yes_no')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{isDisplay}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">触发任务</label>
                <div class="col-sm-8">
                    <select id="triggerTask" name="triggerTask" class="form-control">
                        <option value="">无</option>
                        <option th:each="fantasyTask:${fantasyTaskList}" th:alt-title="${fantasyTask.taskDesc}"
                                th:value="${fantasyTask.taskId}" th:text="${fantasyTask.taskName}"
                                th:selected="${fantasyTask.taskId == fantasyNpcTalk.triggerTask}" value="1">
                            aaa
                        </option>
                    </select>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        var prefix = ctx + "fantasy/talk";
        $("#form-talk-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-talk-edit').serialize());
            }
        }
    </script>
</body>
</html>